<template>
<div class="note-example-box">
	<el-button @click='fnA1'>es6 变量声明</el-button>
	{{numberA1}}:{{objA1.numberA2}}
	<div class="note-code-case">
		<textarea :value='codeVal' disabled style="height: 360px;"></textarea>
	</div>
</div>
</template>
<script setup>
let numberA1 = 'numberA1-11';//起作用
const objA1 = {
	numberA2: 'numberA2-11'
}
const fnA1 = () => {
	console.log('fnA1', 11);
	numberA1 = 'numberA1-22';//不起作用
	objA1.numberA2 = 'numberA2-22';//不起作用
};

const codeVal = `<template>
<el-button @click='fnA1'>es6 变量声明</el-button>
{{numberA1}}:{{objA1.numberA2}}
</template>

<script setup>
let numberA1 = 'numberA1-11';//起作用
const objA1 = {
	numberA2: 'numberA2-11'
}
const fnA1 = () => {
	console.log('fnA1', 11);
	numberA1 = 'numberA1-22';//不起作用
	objA1.numberA2 = 'numberA2-22';//不起作用
};
<script>`;
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>